package org.jeecg.modules.networking.controller;

import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.util.RedisUtil;
import org.jeecg.modules.networking.service.INetWorkingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "对接市局联网")
@RestController
@RequestMapping("/networking/networking")
@Slf4j
public class NetworkingController {

    @Value("${networking.tokenKey}")
    private String tokenKey;//redis中access_token键名
    @Value("${networking.publicKeyKey}")
    private String publicKeyKey;//redis中public_key键名

    @Autowired
    private RedisUtil redisUtil;
    @Autowired
    private INetWorkingService netWorkingService;

    /**
     * 获取访问令牌
     * @return 访问令牌
     */
    @GetMapping("/getToken")
    public String getToken(){
        return netWorkingService.getToken();
    }

    /**
     * 获取公钥
     * @return 公钥
     */
    public String getPublicKey(){
        return netWorkingService.getPublicKey();
    }

}
